package com.ruoyi.management.dao.mapper;

import com.ruoyi.management.pojo.entity.*;
import com.ruoyi.management.pojo.param.AmmeterParam;
import com.ruoyi.management.pojo.param.WXLogin;
import com.ruoyi.management.pojo.po.MouthReadPO;
import com.ruoyi.management.pojo.po.QldbqyinfoPO;
import com.ruoyi.management.pojo.po.UserPO;
import com.ruoyi.management.pojo.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Mapper
public interface WxMapper {

    int updateOpenId(WXloginVO wXloginVO);
    // 根据手机号查询用户信息
    WXloginVO selectUserByPhone(@Param("phone") String phone);
    //修改密码
    Boolean updatepassword(WXLogin wxLogin);
    //通过id修改密码
    WXloginVO selectUserByID(@Param("yhID") Integer yhID);

    List<KhbhDbbh> selectQldbzymx1(@Param("khbh") String khbh);
    //读取单电表每日最新数据
    MouthReadPO selectDayRead(@Param("dbbh") String dbbh);

    MouthReadPO selectMouthRead1(@Param("dbbh") String dbbh);
    //电表编号查电表基础信息
    AmmeterResultVO selectAmmeterx(String dbbh);
    //查电表总数
    Integer selectAmmeterNum(String khbh);
    //查房间总数
    Integer selectRoomNum(String khbh);
    //查询符合条件的电表
    List<KhbhDbbh> selectQldbzymx11(@Param("date") Date date,@Param("khbh") String khbh);
    //查询符合条件的电表（年）
    List<KhbhDbbh> selectQldbzymxYear(@Param("khbh") String khbh);
    //查询符合条件的电表（历史年份）
    List<KhbhDbbh> selectQldbzymxLastYear(@Param("khbh") String khbh,@Param("date") Date date);
    //查询电表历史年度数据
    MouthReadPO selectLastYearRead(@Param("dbbh") String dbbh,@Param("date") Date date);

    MouthReadPO selectLastYearRead1(@Param("dbbh") String dbbh,@Param("date") Date date);
    //租户账单列表
    List<Qldbykhmx> selectBilling(@Param("khbh") String khbh,@Param("hkzt") String hkzt);

    Qldbykhmx selectBillings(@Param("khbh") String khbh,@Param("date") Date date);

    List<QldbydbmxVO> selectdbBillings(@Param("khbh") String khbh,@Param("date") Date date);

    List<YearVO> selectYear(@Param("khbh") String khbh,@Param("year") Integer year);

    List<YearVO> selectDailyReadsByDbbhAndMonth(@Param("dbbh") String dbbh, @Param("month") String month);
    //查询客户详情
    QldbqyinfoVO selectQldbqyinfo(String khbh);
    //查询载体详情
    ZTVO selectZt(String zt);
    //查询容量费用
    Qldbykhmx selectQldbykhmx(@Param("khbh") String khbh,@Param("date") Date date);
    //后付费导航/电费显示(暂无待缴费)
    List<DbkhhsjbVO> selectDbkhhsjb(@Param("khbh") String khbh);
    //是否收取滞纳金
    List<Qldbykhmxa> payment(String khbh);
    //缴费记录
    Qldbyczmx paymentRecord(String khbh);
    //后付费指标块
    Dbysdbb postpaid(@Param("khbh") String khbh,@Param("date") Date date);
    //预充值指标块
    Dbysdbb prepaid(@Param("khbh") String khbh,@Param("date") Date date);
    //开票数据指标块
    DbkhhsjbVO invoice(String khbh);
    //显示所有已收款但未开票
    List<QldbysjmxVO> invoiceShow(@Param("khbh") String khbh,@Param("year") Integer year);
    //最新开票记录
    Qldbykp selectInvoiceRecord(String khbh);

    BigDecimal selectCsyje(String khbh);

    BigDecimal selectKcyje(String khbh);
    //预充值,查询用户所有未付费电费账单
    List<Qldbykhmx> prepaidRecharge(@Param("khbh") String khbh,@Param("zt") String zt);

    Boolean insertQldbyczmx(Qldbyczmx q1);
    //预充值,查询用户所有未付费空调账单
    List<Qldbykhmx> prepaidRechargekt(String khbh);
    //查询是否有公众号openId
    String getGzhOpenid(String sj);
    //租户已收总看板
    DbkhhsjbVO tenantysmx(@Param("khbh") String khbh,@Param("zt") String zt);

    List<RechargeRecord> tenantysmx1(@Param("khbh") String khbh,@Param("zt") String zt);

    List<QldbysjmxVO> tenantysmx11(@Param("khbh") String khbh,@Param("zt") String zt,@Param("date") Date date);
    //查看流水
    List<Qldbyczmx> paymentRecord2(String zt);
    //查询租户是否欠费
    BigDecimal selectWfksjec(@Param("khbh") String khbh,@Param("zt") String zt);
    //
    BigDecimal selectCsyje1(@Param("khbh") String khbh,@Param("zt") String zt);
    //查询电表状态
    Integer selectAmmeterStatus(@Param("khbh") String khbh,@Param("zt") String zt);

    List<AmmeterParam> selectAmmeterStatuss(@Param("zt") String zt,@Param("khbh") String khbh);

    Boolean updateQY(@Param("khbh") String khbh,@Param("zt") String zt);

    WebAdmin selectloginEmployee(String username);

    int updateOpenIdwebAdmin(WebAdmin webAdmin);

    String getGzhOpenidemployee(Integer id);

    BigDecimal selectWfksjec1(String khbh);

    Boolean updateQldbqyinfo(QldbqyinfoPO qldbqyinfoPO);

    List<Qldbykhmx> postpaid1(@Param("khbh") String khbh,@Param("zt") String zt,@Param("status") Integer status,@Param("date") Date date);

    List<DbkhhsjbVO> postpaidShow(@Param("qymc") String qymc,@Param("zt") String zt);

    List<Dbysdba1t> powerOffShow(@Param("zt") String zt,@Param("qymc") String qymc);

    List<Dbysdba1t> powerOffNotice(@Param("zt") String zt,@Param("khbh") String khbh);

    String getSj(@Param("khbh") String khbh);

    List<Qldbyczmx> paymentRecord111(@Param("khbh") String khbh,@Param("zt") String zt,@Param("jflx") Integer jflx,@Param("date") Date date,@Param("qymc") String qymc);

    List<QldbysjmxVO> monthpaymentRecord(@Param("khbh") String khbh,@Param("zt") String zt,@Param("date") Date date);

    BigDecimal monthpaymentRecordSum(@Param("khbh") String khbh,@Param("zt") String zt,@Param("date") Date date);

    List<QldbysjmxVO> wxmonth(@Param("qymc") String qymc,@Param("zt") String zt,@Param("date") Date date,@Param("dbqx") Integer dbqx);

    /**
     * 根据客户编号查询客户信息
     */
    QldbqyinfoVO selectQyInfoByKhbh(String khbh);
}

